{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "aa45abd9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "账号：\n",
      "密码：\n",
      "您输入的账号或密码不正确，请重新输入，您还有 4 次机会\n",
      "账号：\n",
      "密码：\n",
      "您输入的账号或密码不正确，请重新输入，您还有 3 次机会\n",
      "账号：\n",
      "密码：\n",
      "您输入的账号或密码不正确，请重新输入，您还有 2 次机会\n",
      "账号：\n",
      "密码：\n",
      "您输入的账号或密码不正确，请重新输入，您还有 1 次机会\n",
      "账号：\n",
      "密码：\n",
      "您输入的账号或密码错误，1分钟后再试\n",
      "课程表\n",
      "当前时间是: 2021-11-14 23:51 Sunday\n",
      "周末 ！\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#课程表\n",
    "import datetime\n",
    "import time\n",
    "import random\n",
    "\n",
    "user_data = \"suyuqin\"\n",
    "password_data = \"12345\"\n",
    "count = 5\n",
    "while True:\n",
    "    count -= 1  #count-=1等同于count=count-1\n",
    "\n",
    "    username = input(\"账号：\")\n",
    "    password = input(\"密码：\")\n",
    "    if user_data == username:\n",
    "        if password_data == password:\n",
    "            print(\"欢迎%s登录\"%(username))\n",
    "            break\n",
    "        else:\n",
    "            if count == 0:\n",
    "                print(\"您输入的账号或密码错误，1分钟后再试\")\n",
    "                break\n",
    "            else:\n",
    "                print(\"您输入的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")\n",
    "    else:\n",
    "        if count == 0:\n",
    "            print(\"您输入的账号或密码错误，1分钟后再试\")\n",
    "            break\n",
    "        else:\n",
    "            print(\"您输入的账号或密码不正确，请重新输入，您还有\",count,\"次机会\")\n",
    "print(\"课程表\")\n",
    "now_Time = time.strftime(\"%Y-%m-%d %H:%M %A\")\n",
    "print(\"当前时间是:\", now_Time)\n",
    "if now_Time == \"Monday\":\n",
    "    print(\"课程上是.....\")\n",
    "elif now_Time == \"Tuesday\":\n",
    "    print(\"课程上是.....\")\n",
    "elif now_Time == \"Wednesday\":\n",
    "    print(\"课程上是.....\")\n",
    "elif now_Time == \"Thursday\":\n",
    "    print(\"课程上是.....\")\n",
    "elif now_Time == \"Friday\":\n",
    "    print(\"课程上是.....\")\n",
    "else:\n",
    "    print(\"周末 ！\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "077d6353",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
